# Library Makefile for the man package.
#
# Copyright (C) 1994, 1995, Graeme Wilford.
#
# You may distribute under the terms of the GNU General Public
# License as specified in the COPYING file that comes with this 
# distribution.  
#
# Wed June  6 15:44:47 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk):

library = libman.a

srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@

include ../include/Defines

.PHONY: $(DEFAULT_TARGETS) test

override CPPFLAGS := $(DEFS) -I../include -I$(top_srcdir) -I$(srcdir) -I- \
		     $(CPPFLAGS)

ALLSRCS = alloca.c basename.c cleanup.c error.c fnmatch.c getopt.c getopt1.c \
	  glob.c memcmp.c putenv.c realpath.c rename.c \
	  strappend.c strcspn.c strsep.c strspn.c strstr.c xmalloc.c xstrdup.c \
	  waitpid.c tempnam.c

ALLOBJS = $(ALLSRCS:.c=.o)

XOBJS = xstrdup.o xmalloc.o error.o

ALL = @LIBOBJS@ @ALLOCA@ $(libobjects) cleanup.o strappend.o $(XOBJS)

all: $(library)

test: $(library)($(ALLOBJS))
	-$(RANLIB) $(library)

$(library): $(library)($(ALL))
	-$(RANLIB) $@

# The standard targets
install uninstall:

mostlyclean:
	rm -f *~ core $(ALL)

clean: mostlyclean
	rm -f $(library)

distclean: clean
	rm -f Makefile

realclean: distclean
	rm -f tags

TAGS:
	$(MKTAGS) $(srcdir)/*.[ch]
